import QtQuick 2.0
import QtQuick.Controls 2.15
import QtQuick.Window 2.2
import QtQuick.Layouts 1.3
import QtQml.Models 2.15
import QtGraphicalEffects 1.15

CusWindowMask {
    id: root

    CusWindow_w {
        id: win
        width: 680
        height: 450
        anchors.centerIn: parent
        title: TransText.app_setting
        onClose: { root.close()  }
        onVisibleChanged: {  }

        Rectangle {
            anchors.fill: parent
            anchors.topMargin: win.titleHeight + 20
            color: "transparent"

            Rectangle {
                anchors.left: parent.left
                anchors.right: parent.right
                anchors.top: parent.top
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 60
                anchors.leftMargin: 20
                anchors.rightMargin: 20
                radius: 4
                clip: true

                layer.enabled: true
                layer.effect: DropShadow {
                    color: "#3b000000"
                    samples: 16
                    radius: 6
                }

                Rectangle {
                    id: baseTitleRect
                    anchors.top: parent.top
                    anchors.left: parent.left
                    anchors.right: parent.right
                    implicitHeight: 24
                    anchors.topMargin: 10
                    color: "transparent"

                    RowLayout {
                        anchors.fill: parent
                        anchors.leftMargin: 10
                        spacing: 6

                        Rectangle {
                            implicitWidth: 4
                            implicitHeight: 16
                            color: "#3986FF"
                            radius: width / 2
                        }

                        Text {
                            text: TransText.app_baseSetting
                            color: "#4d4d4d"
                            font.pixelSize: 14
                            font.weight: Font.Medium
                        }

                        Item {
                            Layout.fillWidth: true
                        }
                    }
                }

                ScrollView {
                    anchors.top: baseTitleRect.bottom
                    anchors.left: parent.left
                    anchors.right: parent.right
                    anchors.bottom: parent.bottom
                    anchors.topMargin: 10
                    clip: true
                    contentHeight: 340

                    MouseArea {
                        anchors.fill: parent
                        onClicked: {
                            forceActiveFocus()
                        }
                    }

                    Rectangle {
                        id: leftRect
                        implicitWidth: parent.width / 2
                        anchors.left: parent.left
                        anchors.top: parent.top
                        anchors.bottom: parent.bottom
                        color: "transparent"
                        clip: true

                        GridLayout {
                            //anchors.fill: parent
                            anchors.left: leftRect.left
                            anchors.leftMargin: 20
                            anchors.rightMargin: 10
                            rows: 3
                            columns: 2
                            rowSpacing: 10

                            //row 1
                            Text {
                                text: TransText.app_emailSender
                                color: "#4D4D4D"
                                font.pixelSize: 13
                                font.styleName: "Regular"
                                Layout.fillWidth: true
                            }

                            CusTextField {
                                id: emailSender
                                Layout.topMargin: 4
                                implicitWidth: 200
                                implicitHeight: 25
                                enabled: false
                                //placeholderText: TransText.app_EnterAddress
                            }

                            //row 2
                            Text {
                                text: TransText.app_emailRecver
                                color: "#4D4D4D"
                                font.pixelSize: 13
                                font.styleName: "Regular"
                                Layout.fillWidth: true
                            }

                            CusTextField {
                                id: emialRecver
                                Layout.topMargin: 4
                                implicitWidth: 200
                                implicitHeight: 25
                                enabled: false
                                //placeholderText: TransText.app_EnterAddress
                            }

                            //row 3
                            Text {
                                text: TransText.app_emailAuthCode
                                color: "#4D4D4D"
                                font.pixelSize: 13
                                font.styleName: "Regular"
                                Layout.fillWidth: true
                            }

                            CusTextField {
                                id: emailAuthCode
                                Layout.topMargin: 4
                                implicitWidth: 200
                                implicitHeight: 25
                                enabled: false
                                //placeholderText: TransText.app_EnterAddress
                            }
                        }

                        Item {
                            Layout.columnSpan: 3
                            Layout.fillHeight: true
                        }
                    }

                    ColumnLayout {
                        id: cccc
                        anchors.left: leftRect.right
                        anchors.right: parent.right
                        anchors.top: parent.top
                        anchors.rightMargin: 20
                        anchors.leftMargin: 10

                        RowLayout {
                            Layout.fillWidth: true
                        }
                    }
                }
            }

            Rectangle {
                anchors.left: parent.left
                anchors.right: parent.right
                anchors.bottom: parent.bottom
                anchors.bottomMargin: win.windowRadius
                implicitHeight: 30
                color: "transparent"

                CusSolidBtn {
                    id: oKBtn
                    anchors.right: parent.right
                    anchors.verticalCenter: parent.verticalCenter
                    anchors.rightMargin: 20
                    implicitWidth: 96
                    implicitHeight: 30
                    _text: TransText.app_OK
                    _fontSize: 14

                    onClicked: {
                        oKBtn.focus = true
                        close()
                    }
                }
            }
        }

    }

}
